/*
测试除零异常
 */
import org.example.Arithmetic;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.*;
public class testDivide {
    @Test
    public void test(){
        Throwable tx=null;
        try{
            new Arithmetic(5,0).divide();
        }catch (Exception ex){
            tx=ex;
        }
        assertNotNull(tx,"出现NotNullError！");
        assertEquals(Exception.class,tx.getClass());
        assertEquals("除数不能为零！",tx.getMessage());

    }
}
